package com.hunan.api.catv.entity.enums;

/**
 * 视频转码模板
 *
 * @author zbx
 */
public enum VideoDefinitionEnum {

    FLU(210, "FLU"),

    SD(220, "SD"),

    HD(230, "HD"),

    FHD(240, "FHD");

    private final Integer code;

    private final String value;


    VideoDefinitionEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static VideoDefinitionEnum getResult(int code) {
        VideoDefinitionEnum[] rcs = VideoDefinitionEnum.values();
        for (VideoDefinitionEnum rc : rcs) {
            if (rc.getCode() == code) {
                return rc;
            }
        }
        return null;
    }

    public static String getValue(String code) {
        VideoDefinitionEnum[] rcs = VideoDefinitionEnum.values();
        for (VideoDefinitionEnum rc : rcs) {
            if (rc.getCode().toString().equals(code)) {
                return rc.getValue();
            }
        }
        return "FLU";
    }
}
